package com;

import com.alibaba.fastjson.JSONObject;
import com.yuhang.demo.PmTest;
import com.yuhang.demo.util.PostUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @user yuhang
 * @desc
 * @since 2022/1/19
 */
public class ServiceFeeTest {


    static String api = "http://apicommon.go2b2b.com/";
//    static String api = "http://127.0.0.1:8085";

//        static String api = "http://127.0.0.1:8089";
    public static void main(String[] args) throws Exception {
//        String result = updateTrialSupplier();
//        String result =  payForService();
        String result=getWxPayInfo();
//        String result=serviceFee();

//        String result=goldApplyAuth();
//        String result=goldActionUpdate();

//        String result=auth();
//        String result=  authInfo();
//        String result= getSupplier();
//        String result=getWaitGold();
//        String result = confirm();
//        String result=getTransTag();

//        String result=xxg();
//        String result=getSupplier();
//        String result=paySuccess();
//        String result=yshinfo();
        System.out.println(result);
    }



    public static String xxg() throws Exception {
        String url = api + "/message/sendAndSaveMessage";
        String ss="{\"articleNumber\":\"原色牛仔套装-桃子图\",\"changePrice\":62.00,\"content\":\"“乐小小童装”货号为“原色牛仔套装-桃子图”的商品价格由“55.00元”调整到“62.00元”；请及时更新信息。\",\"dynamicType\":4,\"orgPrice\":55.00,\"productId\":2636345,\"supplierId\":482803,\"title\":\"商品涨价提醒\",\"type\":\"product_price_increase\"}";

        return PostUtil.httpServiceFee(url, JSONObject.parseObject(ss,Map.class));
    }

    /**
     * 数据转移
     * @return
     * @throws Exception
     */
    public static String yshinfo() throws Exception {
        String url = api + "/api/supplier/auth/yshinfo/702033";
        Map<String, Object> params = new HashMap<String, Object>();
        return PostUtil.httpServiceFeeGet(url,params);
    }




    public static String confirm() throws Exception {
        String url = api + "/api/trans/confirm";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("userId", "959459");
        return PostUtil.httpServiceFee(url, params);
    }
    public static String getTransTag() throws Exception {
        String url = api + "/api/trans/getTransTag";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("userId", "663267");
        return PostUtil.httpServiceFee(url, params);
    }



    public static String getWaitGold() throws Exception {
        String url = api + "/api/service/supplier/getWaitGold";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("source", "e3e3");
        params.put("supplierId", "314882");
        return PostUtil.httpServiceFee(url, params);
    }


    public static String getSupplier() throws Exception {
        String url = api + "/api/service/supplier/getSupplier";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("supplierId", "482803");
        return PostUtil.httpServiceFee(url, params);
    }

    public static String authInfo() throws Exception {
        String url = api + "/api/supplier/auth/info/"+314911;
        Map<String, Object> params = new HashMap<String, Object>();
        return PostUtil.httpServiceFeeGet(url, params);
    }



    public static String auth() throws Exception {
        String url = api + "/api/supplier/auth";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("idCard", "510922199510194674");
        params.put("idCardImage", "http://go2.test.ximgs.net/2/202/20220214/20220214151004322_750.jpeg");
        params.put("licenceImage", "http://go2.test.ximgs.net/2/202/20220214/20220214151009520202202141510095200_750.jpeg");
        params.put("userId", "206");
        params.put("username","xx");
        return PostUtil.httpServiceFee(url, params);
    }
    public static String goldActionUpdate() throws Exception {
        String url = api + "/api/service/back/goldActionUpdate";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("payId", 6791);
        params.put("audit", 2);
        params.put("operatorId", "272");
        params.put("serviceStartDate", "2022-03-15");
        params.put("serviceEndDate", "2023-04-15");
        params.put("comment", "test");
        return PostUtil.httpServiceFee(url, params);
    }
    public static String goldApplyAuth() throws Exception {
        String url = api + "/api/service/back/goldApplyAuth";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("state", 2);
        params.put("operatorId", 272);
        params.put("operatorName", "ganyf");
        params.put("applyId", "1004");
        params.put("keyword", "applyId");
        params.put("serviceStartDate", "2022-02-15");
        params.put("serviceEndDate", "2023-04-15");
        params.put("comment", "test");
        return PostUtil.httpServiceFee(url, params);
    }


    public static String serviceFee() throws Exception {
        String url = api + "/api/config/serviceFee";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("supplierUserId", 1270813);
//        params.put("serviceType", 1);
        return PostUtil.httpServiceFee(url, params);
    }


    public static String updateTrialSupplier() throws Exception {
        String url = api + "/api/trial/updateTrialSupplier";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("supplierId", 33);
        params.put("operatorId", 0);
        params.put("operatorName", "test");
        params.put("grade", 1);
        params.put("duration", 1);
        params.put("comment", "123");
        return PostUtil.httpServiceFee(url, params);
    }

    public static String getWxPayInfo() throws Exception {
        String url = api + "/api/callback/getWxPayInfo";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("payId", 23055);
        return PostUtil.httpServiceFee(url, params);
    }

    public static String payForService() throws Exception {
        String url = api + "/api/pay/payForService";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("supplierId", 702053);
        params.put("serviceAmount", 0);
        params.put("marginAmount", "0.01");
        params.put("payType", 1);
        params.put("password", "123456");
        params.put("device", "ios");
        params.put("discountTag", "0");
        params.put("targetGrade", "2");
        params.put("selectType", "4");
        params.put("createIp", "127.0.0.1");
        params.put("createMac", "127.0.0.1");
        params.put("returnUrl", "127.0.0.1");
        return PostUtil.httpServiceFee(url, params);
    }
}
